<?php
/**
 * Created by PhpStorm.
 * User: alinejun
 * Date: 2019/1/6
 * Time: 22:09
 */
namespace app\admin\validate;

/**
 * 文章验证器
 */
class Goods extends AdminBase
{

    // 验证规则
    protected $rule =   [
        'name'          => 'require',
        'detail'       => 'require',
        'category'   => 'require',
    ];

    // 验证提示
    protected $message  =   [
        'name.require'         => '商品名不能为空',
        'detail.require'      => '商品介绍不能为空',
        'category.require'  => '商品分类必须选择',
    ];

    // 应用场景
    protected $scene = [
        'edit'  =>  ['name', 'detail', 'category']
    ];
}